"""
author：wang tian cheng
date: 2020/10/27
project: ludingji
"""
# import random
# with open("mac.txt","a") as fp3:
#     for i in range(100):
#         a=random.randint(0,16**2)
#         b=random.randint(0,16**2)
#         c=random.randint(0,16**2)
#         d=hex(a)
#         e=hex(b)
#         f=hex(c)
#         mac=f"01-AF-3B-{d[2:4]}-{e[2:4]}-{f[2:4]}"'\n'
#         fp3.write(mac)

<<<<<<< HEAD
# import random
# import string
# #随机生成一个mac地址
# def create_mac():
#     mac = '01-AF-3B'
#     hex_num = string.hexdigits
#     for i in range(3):
#         n = random.sample(hex_num,2)
#         sn = '-' + ''.join(n).upper()
#         mac += sn
#     return mac
#
# #随机生成100个mac地址
# def main():
#     with open('mac.txt','w') as f:
#         for i in range(100):
#             Mac = create_mac()
#             print(Mac)
#             f.write(Mac + '\n')
#
# main()
=======

import random
import string

#随机生成一个mac地址
def create_mac():
    mac = '01-AF-3B'
    hex_num = string.hexdigits
    print(hex_num)
    for i in range(3):
        n = random.sample(hex_num,2)
        sn = '-' + ''.join(n).upper()
        mac += sn
    return mac

#随机生成100个mac地址
def main():
    with open('mac.txt','w') as f:
        for i in range(100):
            Mac = create_mac()
            print(Mac)
            f.write(Mac + '\n')

main()
>>>>>>> 2db4004b938f10e0d22d9498926facae78e01b13
